/* Program: BlinkC
*  Author: Gireesan Namboothiri P, NetSLab IIT Madras	
*  This program is part of introductory program development in TinyOS 2.10 
*  You are free to modify or redistribute the program
*  The author will not be responsible for any loss of data/other damages if any, by using this software  
*/
#include "Timer.h"
module BlinkC
{
  uses interface Leds;
  uses interface Boot;
  uses interface Timer<TMilli> as T0;
}
implementation
{
	uint8_t counter=0;
	event void Boot.booted() 
	{
  		call T0.startPeriodic( 250 );     
	}
	event void T0.fired()
  	{
  		counter++;
  		if(counter & 0x1)
  			{
  				call Leds.led0On(); 
  			}
  		else
  		{
  			call Leds.led0Off();
  		}
  		if(counter & 0x2)
  			{
  				call Leds.led1On(); 
  			}
  		else
  		{
  			call Leds.led1Off();
  		}
  		if(counter & 0x4)
  			{
  				call Leds.led2On(); 
  			}
  		else
  		{
  			call Leds.led2Off();
  		}
   }
}
